<template>
	<!-- 限时福利 -->
	<view class="limitCard1 pf" >
		<!-- <image class="limitbg1" :src="img"></image> -->
		<view class="fitCard1 pr">
			<view class="cardList1 pa">
				<view class="limit1 x-start" v-for="(item,index) in limitFits" :key="index" v-if="index<2" @click="jump(item)">
					<image :src="item.list_pic_url" mode=""></image>
					<view class="cardText1  pr">
						<view class="name1">{{item.spu_name}}</view>
						<view class="score1"><span>{{item.points}}</span>积分<span class="active">{{item.points}}0积分</span></view>
					</view>
				</view>
				
			</view>
			<view class="sumbitUse1 x-c pa" @click="seeMore">查看更多</view>
			<view class="closeCard1 pa" @click="closeBtn">
				<image src="/static/image/close.png"></image>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				img: this.imgUrl + 'couponCard.png',
				detail_url: '/pages/goods/detail/index',
			}
		},
		props: {
			isFit: {
				type: Boolean,
				default: false
			},
			limitFits: {
				type: Array,
				default: []
			},
		},
		methods: {
			jump(item) {
				let obj = {
					"spu_id": item.spu_id,
					"sku_id": item.sku_id,
					"member_id": 1 // 会员id
				}
				this.$api('giftinfo',obj).then(res => {
					let goods = res.data;
				    this.$store.dispatch('goods/get_goodsInfo',goods)
				})
				this.$store.dispatch('goods/get_detail',item)
			    this.$Router.push({
			        path: '/pages/goods/detail/index',
					params: 'params'
			    })
			},
			closeBtn() {
				this.$emit('closeBtn');	
			},
			seeMore(val) {
				this.$emit('seeMore',val);	
			}
		}
	}
</script>

<style lang="scss" scoped>
	// 限时优惠劵
		.limitCard1 {
			width: 100%;
			height: 100%;
			top: 0;
			bottom: 0;
			right: 0;
			left: 0;
			z-index: 99;
			background-color: rgba(#000,0.7);
			.closeCard1 {
				bottom: -73px;
				left: 49%;
				margin-top: 50rpx;
				image {
					width: 56rpx;
					height: 56rpx;
				}
			}
			.fitCard1 {
				z-index: 999;
				background: url(https://mystore-1304299581.cos.ap-guangzhou.myqcloud.com/static/image/couponCard.png) no-repeat;
				background-size: 100% 100%;
				width: 700rpx;
				height: 864rpx;
				top: 18%;
				left: 0;
				.cardList1 {
					color: #333;
					top: 45%;
					left: 27%;
					image {
						width: 130rpx;
						height: 130rpx;
						border-radius: 10rpx;
					}
					.limit1 + .limit1 {
						padding-top: 33rpx;
					}
					.limit1 {
						.cardText1 {
							padding: 0 0 50rpx 10rpx;
							.name1 {
								width: 237rpx;
								text-align: left;
								color: #333;
								font-size: 26rpx;
								font-weight: 700;
								line-height: 40rpx;
								overflow: hidden;
								white-space: nowrap;
							}
							.score1 {
								padding-top: 30rpx;
								text-align: left;
								font-size: 24rpx;
								color: #e93323;
							}
							.active {
								padding-left: 12rpx;
								text-decoration:  line-through;
								font-size: 22rpx;
								color: #999;
							}
						}
						&::before{
							content: '';
							position: absolute;
							padding: 155rpx 0 0 0;
							width: 396rpx;
							height: 1rpx;
							border-bottom: 1px dashed #dcdcdc;
						}
					}
				}
				.sumbitUse1 {
					bottom: 6%;
					left: 27%;
					width: 394rpx;
					height: 60rpx;
					background: linear-gradient(269deg,#ff977b 5%, #ff2d1b 95%);
					border-radius: 30rpx;
					color: #fff;
					font-size: 22rpx;
					transform: translateX(-5rpx);
				}
			}
		}
</style>
